<?php
require_once ("../src/db/connectdatabase.php");

function getIntroLoan($idloan) {
	$con = new ConnectDB();
	$tbl = "loans";
	$fn = array('intro_question_header');
	$condetion = array('loan_id' => $idloan);
	return $con -> getvalue($tbl, $fn, $condetion);
}

if(isset($_GET['as'])) {
	$idloan = $_GET['as'];
	if($idloan == "vay_the_chap" || $idloan == "vay_tra_gop" || $idloan == "vay_ca_nhan") {
		$stringloan = "";
		if($idloan == "vay_the_chap") {
			$stringloan = "Vay Thế Chấp";
		} else if($idloan == "vay_tra_gop") {
			$stringloan = "Vay Trả Góp";
		} else if($idloan == "vay_ca_nhan") {
			$stringloan = "Vay Cá Nhân";
		}
		
		$introloan = getIntroLoan($idloan);
?>
<h3>Thông Tin Giới Thiệu Câu Hỏi Cho <?php echo($stringloan) ?></h3>
<div>
	<div><?php if(count($introloan) > 0) {echo($introloan[0][0]);} ?></div>
    <div><a href="admin.php?content=quanlivay&&as=<?php echo($idloan) ?>&&adrt=edit-intro-hoi-dap"><input type="button" value="Chỉnh Sửa" style="border-radius: 5px; cursor:pointer; padding:5px; width:100px; background:#03F; color:#FFF; font-weight:bold;" /></a></div>
</div>
<?php
	}
}
?>